package com.ynding.cloud.auth.authentication.service;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Administrator
 */
public interface IAuthenticationService {
    /**
     * 校验权限
     *
     * @param authRequest
     * @return 是否有权限
     */
    boolean decide(HttpServletRequest authRequest);

    /**
     * 校验权限
     * @param authorization Bearer token
     * @param url 请求地址
     * @param method 方法
     * @return
     */
    boolean auth(String authorization, String url, String method);

    /**
     * 是否无效authentication
     *
     * @param authentication
     * @return
     */
    boolean invalidJwtAccessToken(String authentication);

    /**
     * 获取token
     * @param username 用户名
     * @param password 用户名密码
     * @param clientId appId
     * @param clientSecret app密码
     * @return
     */
    String getToken(String username, String password, String clientId, String clientSecret);

    /**
     * 刷新token
     * @param refreshToken token
     * @param clientId appId
     * @param clientSecret app密码
     * @return
     */
    String refreshToken(String refreshToken, String clientId, String clientSecret);

}
